home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_wndw.arc / MENU_XXX.C < prev    next >
Text File  |  1990-01-28  |  2KB  |  60 lines

  1. /*  (c) Marietta Systems, Inc.  1987
  2. *   All rights reserved
  3. *
  4. *   Demonstration program for functions menu and top_menu
  5. */
  6. #include "mtest.h"
  7. void main(){
  8. int a = 3, b = 2, k = 1;
  9. static byte disc[] = " :";
  10. TOP_LINE = 2; /* allow for second line at top for menu */
  11. clr_scrn("Menu test");
  12. /* 
  13. *    create a 6 line, 24 column window at location (5,15) 
  14. */
  15. if ( 1 > mk_wndw(5, 15, 14, 50,"menu")) goodbye(101); 
  16. menu_1: display ("Select your 'C' compiler", 1, 2, high);
  17. /*
  18. *    Use top_menu to select C compiler
  19. */
  20. a = top_menu("Lattice C&Quick C&Turbo C&",15, a);
  21. if (a < 0) goodbye(102);
  22. switch (a){
  23.      case 0:   goodbye(0);
  24.      case 1:   display("Lattice selected        ",1,2,blink); break;
  25.      case 2:   display("Microsoft selected      ",1,2,blink); break;
  26.      case 3:   display("Borland selected        ",1,2,blink); break;
  27.      }
  28. display("Now select target drive code:",2,2,high);
  29. /*
  30. *     create a 5 line, 2 column window at location (10,40)
  31. *     and create a 5 line menu, highlighting the 2nd item.
  32. */
  33. menu_2: if (1 > mk_wndw(10, 40, 18, 43, NULL)) goodbye(103);
  34. b = menu("B:&C:&D:&E:&F:&", 2, b, 1);
  35. if (b < 0) goodbye(104);
  36. rm_wndw(); 
  37. if (!b) {scroll (1,1); goto menu_1;}
  38. disc[0] = b + 65; display (disc, 2, 32, high);
  39. display("Target drive code selected is ", 2, 2, low);
  40. /*
  41. *     create a 4 line menu, 1 item per line, starting at line 4,
  42. *     column 3 of the window, and highlight the 1st item.
  43. */
  44. display("Now select transfer", 3, 2, high);
  45. k =  1;
  46. set_crsr(4, 3);
  47. k = menu("Compact Model&Header File&SMall Model&SOurce&", 15, k, 1);
  48. if (k < 0) goodbye(105); 
  49. scroll(5,2);
  50. if (!k) goto menu_2;
  51. switch (k){
  52.     case 1: display("Compact model selected    ", 3, 2, high); break;
  53.     case 2: display("Header File selected      ", 3, 2, high); break;
  54.     case 3: display("Small model selected      ", 3, 2, high); break;
  55.     case 4: display("Source selected           ", 3, 2, high); break;
  56.     }
  57. if (k && !disp_qry("Around again")) goodbye(0);
  58. scroll(1,2);
  59. goto menu_2;
  60. }